import { IsString, IsNotEmpty, MaxLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateCategoryDto {
  @ApiProperty({ description: '分类编码' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(50)
  code: string;

  @ApiProperty({ description: '分类名称' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(100)
  name: string;
}

export class CreateLevel2CategoryDto extends CreateCategoryDto {
  @ApiProperty({ description: '一级分类ID' })
  @IsNotEmpty()
  level1Id: bigint;
}

// ... 类似地添加 Level3 到 Level6 的 DTO